package com.yztc.orangeentertainment.ui.main.subscribefragment.subconfragment;

import android.content.Context;


import com.yztc.orangeentertainment.adapter.SubConAdapter;
import com.yztc.orangeentertainment.bean.subscribebean.LabelBean;
import com.yztc.orangeentertainment.config.SubscribeUrlConfig;

import java.util.List;
import java.util.Map;

/**
 * Created by My on 2016/10/6.
 */
public class ConPresenter implements ConContract.Presenter {
    private ConContract.View view;
    private ConModle modle;
    private int index;

    public ConPresenter(ConContract.View view, int index) {
        this.view = view;
        this.modle = new ConModle();
        this.index=index;
    }
    @Override
    public void getConFromNet(Map<String, String> params, final Context context) {
        modle.getConAll(index, SubscribeUrlConfig.PATH.URL_TYPE, params, new OnLoadMiddleListener() {
            @Override
            public void onSuccess(List<LabelBean> list) {
                view.onLoadConSuccess(list);
            }

            @Override
            public void onFailure(Exception e) {
                view.onLoadConFail(e.getMessage() + "");
            }
        },context);
    }

    @Override
    public void getConFromDb() {

    }
}
